﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Xpus.YouYTube.Data;

namespace Xpus.YouYTube.WebSite.Controllers
{
	public class HomeController : Controller
	{
		public void Index()
		{
			using (TDataContext db = new TDataContext())
			{
				var qNewVideos = from v in db.TVideos
								 where v.IsDeleted == false
								 orderby v.AddedTime descending
								 select v;
				ViewData["NewVideos"] = qNewVideos.Take(50).ToArray();
			}

			RenderView("HomeIndex");
		}
	}
}
